#include "librarymanagement.h"
#include "ui_librarymanagement.h"
#include "adminsystem.h"
#include <QSqlDatabase>
#include <QSqlError>

LibraryManagement::LibraryManagement(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::LibraryManagement)
{
    ui->setupUi(this);
    model = new QSqlTableModel(this);
    model->setTable("book");
    model->setFilter("Repertory < 10");
    model->select();
    ui->tableView->setModel(model);
}

LibraryManagement::~LibraryManagement()
{
    delete ui;
}

void LibraryManagement::on_pushButtonReturnAdminsystem_clicked()
{
    AdminSystem *admin = new AdminSystem;
    admin->show();
    close();
}

void LibraryManagement::on_pushButton_clicked()
{
    close();
}
